import React from 'react';
import classNames from 'classnames';
import './line.less';

class Line extends React.Component {
  render() {
    const {type, className, size} = this.props;
    const cls = classNames('pl-line', [className, `line-${type}`]);
    let style = this.props.style || {};
    if (type === 'horizontal') {
      style.height = `${size}px`;
    } else if (type === 'vertical') {
      style.width = `${size}px`;
    }
    return (<div className={cls} style={style} />)
  }
}

export default Line;
Line.defaultProps = {
  type: 'horizontal',
  size: 1
};
